//
//  SupriseDataListModel.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/12.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class SupriseDataListModel: NSObject {
    var od_id = "-999"
    var goods_image = "-999"
    var countdown = "-999"
    
    var od_count = "-999"
    var od_type = "-999"
    var od_progress = "-999"
    var od_buy_count = "-999"

    var goods_info : SurpriseGoodsInfoModel?
    
       
    init(dic : [String : AnyObject]) {
        super.init()
        
        setValuesForKeys(dic)
        
    }
    
    
    override func  setValue(_ value: Any?, forKey key: String) {
        
        if key == "goods_info" {
            
            if let temp = value as? [String : AnyObject]{
                
                goods_info = SurpriseGoodsInfoModel(dic:temp )
                
            }
            
        } else {
            
            
            super.setValue(value, forKey: key)
        }
        
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
        
    }
    
    
    //在swift中想要打印对象要以下重写属性
    override var description: String{
        let keys = ["od_count","od_id","od_type","od_progress","od_buy_count","goods_info","goods_image","countdown"]
        let dic = dictionaryWithValues(forKeys: keys)
        return "\(dic)"
    }
    
}
